package com.swxy.club.utils;

import com.swxy.club.dto.bo.CurrentUserBO;

/**
 * @author 易
 */
public class UserContext {

    private static final ThreadLocal<CurrentUserBO> CURRENT_USER = new ThreadLocal<>();

    public static void setCurrentUser(CurrentUserBO user) {
        CURRENT_USER.set(user);
    }

    public static CurrentUserBO getCurrentUser() {
        return CURRENT_USER.get();
    }

    public static void clear() {
        CURRENT_USER.remove();
    }

}
